package priv.dajie.tzzq.bot.model;

import java.util.ArrayList;
import java.util.HashMap;

public class BuyHistoryItems extends ArrayList<BuyHistoryItem> {

    private HashMap<String, BuyHistoryItem> map = null;

    public synchronized HashMap<String, BuyHistoryItem> getMap(){
        if(map == null) {
            map = new HashMap<>();
            for (BuyHistoryItem buyHistoryItem : this) {
                map.put(buyHistoryItem.getBuyID(), buyHistoryItem);
            }
        }
        return map;
    }

}
